﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class HandleChatItem : MonoBehaviour
{
    [SerializeField]
    private Image m_Icon = null;

    [SerializeField]
    private Text m_NameText = null;

    [SerializeField]
    private TextExtend m_Data = null;

    [SerializeField]
    private RectTransform m_ItemRect = null;

    public RectTransform Rect
    {
        get
        {
            return m_ItemRect;
        }
    }

    [SerializeField]
    private RectTransform m_DataBg = null;

    Vector2 Size = Vector2.one;
    Vector2 offset = new Vector2(0, 137.5f * 0.5f);
    public string Text
    {
        get
        {
            return m_Data.text;
        }
        set
        {
            m_Data.text = value;
            Size.x = 360;
            Size.y = m_Data.preferredHeight + 30.0f;
            m_ItemRect.sizeDelta = Size + offset;
            m_DataBg.sizeDelta = Size;
        }
    }
}
